package com.mayfool.task.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 代码仓库类型
 * @author zhou.xu 2024/8/26 19:11
 */
@AllArgsConstructor
@Getter
public enum RepoTypeEnum {

    /**
     * 本地
     */
    LOCAL(0),
    /**
     * 远程
     */
    REMOTE(1);

    private final int code;

    public static RepoTypeEnum getByCode(int code) {
        for (RepoTypeEnum repoTypeEnum : RepoTypeEnum.values()) {
            if (repoTypeEnum.getCode() == code) {
                return repoTypeEnum;
            }
        }
        return null;
    }

}
